import * as THREE from 'three';

export default function (camera: THREE.PerspectiveCamera, renderer: THREE.WebGLRenderer) {
  const w = window.innerWidth,
    h = window.innerHeight,
    proportion = w / h,
    PR = 1920 / w;
  // 更新摄像头
  camera.aspect = proportion;
  // 更新摄像机投影矩阵
  camera.updateProjectionMatrix();

  // 设置渲染器的像素比
  renderer.setPixelRatio(PR > 1 ? 1 : PR);
  // 更新渲染器
  renderer.setSize(window.innerWidth, window.innerHeight);
}
